
import requests
import traceback


# Wechat Robot接收消息的API endpoint
URL = "http://localhost:8081/msg"


def send_msg(msg='') -> bool:
    try:
        res = requests.post(url=URL, json={"message": msg}, timeout=2)
        return (res.status_code == 200)
    except:
        traceback.print_exc()
        return False


if __name__ == "__main__":
    send_msg("Hello !")
